package com.zsl.swing.redis.desktop.window.list.oftenusekey;

import java.util.Objects;

public class OftenUseKeyPatternListNode {

    private String uniqueId;

    private int dbIndex;

    private String oftenUseKeyPattern;

    private long updateMils;

    public long getUpdateMils() {
        return updateMils;
    }

    public void setUpdateMils(long updateMils) {
        this.updateMils = updateMils;
    }

    public String getUniqueId() {
        return uniqueId;
    }

    public void setUniqueId(String uniqueId) {
        this.uniqueId = uniqueId;
    }

    public int getDbIndex() {
        return dbIndex;
    }

    public void setDbIndex(int dbIndex) {
        this.dbIndex = dbIndex;
    }

    public String getOftenUseKeyPattern() {
        return oftenUseKeyPattern;
    }

    public void setOftenUseKeyPattern(String oftenUseKeyPattern) {
        this.oftenUseKeyPattern = oftenUseKeyPattern;
    }

    @Override
    public String toString() {
        return this.oftenUseKeyPattern;
    }

    @Override
    public boolean equals(Object obj) {

        if(Objects.isNull(obj)){
            return false;
        }

        if(!(obj instanceof OftenUseKeyPatternListNode )){
            return false;
        }

        OftenUseKeyPatternListNode other = (OftenUseKeyPatternListNode)obj;
        return this.oftenUseKeyPattern.equals(other.getOftenUseKeyPattern());
    }
}
